package com.sc.nft.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.dao.DigitalCollectionProductInfoAuctionUserBiddingDao;
import com.sc.nft.dao.DigitalCollectionProductInfoAuctionUserConditionDao;
import com.sc.nft.entity.dto.AuctionConsumeAdminPageDTO;
import com.sc.nft.entity.dto.AuctionConsumeUserDetailAdminPageDTO;
import com.sc.nft.entity.vo.AuctionConsumeAdminPageVO;
import com.sc.nft.entity.vo.AuctionConsumeUserDetailAdminPageVO;
import com.sc.nft.service.DigitalCollectionProductInfoAuctionUserBiddingService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户拍卖出价表 服务实现类
 * </p>
 *
 * @author liGen
 * @since 2024-09-05
 */
@Slf4j
@RequiredArgsConstructor
@Service
public class DigitalCollectionProductInfoAuctionUserBiddingServiceImpl implements DigitalCollectionProductInfoAuctionUserBiddingService {

    private final DigitalCollectionProductInfoAuctionUserBiddingDao digitalCollectionProductInfoAuctionUserBiddingDao;

    private final DigitalCollectionProductInfoAuctionUserConditionDao digitalCollectionProductInfoAuctionUserConditionDao;

    /**
     * 消耗藏品总数列表
     * @param auctionConsumeAdminPageDTO
     * @return
     */
    @Override
    public Page<AuctionConsumeAdminPageVO> getAuctionConsumeAdminPage(AuctionConsumeAdminPageDTO auctionConsumeAdminPageDTO) {

        if (auctionConsumeAdminPageDTO.getType().equals(0)){
            return digitalCollectionProductInfoAuctionUserBiddingDao.getAuctionConsumeAdminPage(auctionConsumeAdminPageDTO.getProductId(), auctionConsumeAdminPageDTO.toMp());
        }
        return digitalCollectionProductInfoAuctionUserConditionDao.getauctionPropAdminPage(auctionConsumeAdminPageDTO.getProductId(), auctionConsumeAdminPageDTO.toMp());
    }

    /**
     * 消耗藏品总数列表
     * @param auctionConsumeUserDetailAdminPageDTO
     * @return
     */
    @Override
    public Page<AuctionConsumeUserDetailAdminPageVO> getAuctionConsumeUserDetailAdminPage(AuctionConsumeUserDetailAdminPageDTO auctionConsumeUserDetailAdminPageDTO) {

        return digitalCollectionProductInfoAuctionUserBiddingDao.getAuctionConsumeUserDetailAdminPage(
                auctionConsumeUserDetailAdminPageDTO.getProductId(),auctionConsumeUserDetailAdminPageDTO.getUserId(),auctionConsumeUserDetailAdminPageDTO.toMp());
    }


}
